home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 020a / rmastr02.zip / DEMO2.PAS < prev    next >
Pascal/Delphi Source File  |  1991-09-22  |  1KB  |  53 lines

  1. (*
  2.  
  3.    ----------------------------------------------------------
  4.    WriteBgf procedure                                   RWBgf
  5.    ----------------------------------------------------------
  6.  
  7.    Function   : Writes an image as a BGF file.
  8.  
  9.    Decloration: WriteBgf(Filename : String; X1,Y1,X2,Y2 : Word; Img : Pointer)
  10.  
  11.    Remarks    : I/O checking is NOT performed.
  12.                 Images cannot be more than 64K.
  13.                 Images that are more than 100 pixels
  14.                 in width or height cannot be loaded
  15.                 in Raster Master.
  16.  
  17. *)
  18.  
  19.  
  20.  
  21.  
  22. Program Demo2;
  23.  Uses Graph,RWBgf;
  24. Var
  25.  Img  : Pointer;
  26.  Size : Word;
  27.  Gd   : Integer;
  28.  Gm   : Integer;
  29. Begin
  30.  Gd:=EGA;
  31.  Gm:=EGAhi;
  32.  InitGraph(Gd,Gm,'');
  33.  
  34.  SetFillStyle(SlashFill,LightGray);        (* Draw something to save *)
  35.  Bar(2,2,49,49);
  36.  SetColor(White);
  37.  Rectangle(1,1,50,50);
  38.  SetColor(LightGreen);
  39.  OutTextXY(2,10,'RASTER');
  40.  OutTextXY(2,30,'MASTER');
  41.  
  42.  Size:=ImageSize(1,1,50,50);               (* Grab the Image *)
  43.  GetMem(Img,Size);
  44.  GetImage(1,1,50,50,Img^);
  45.  
  46.  WriteBgf('BOX.BGF',1,1,50,50,Img);        (* Save the Image *)
  47.  
  48.  FreeMem(Img,Size);                        (* Release the memory *)
  49.  
  50.  ReadLn;                                   (* Wait for Enter Key *)
  51.  
  52.  CloseGraph;                               (* Close graphics *)
  53. End.